/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.entity;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.test.entity.TestDataChild;
import com.jeesite.modules.xcxAdmin.entity.ZtAdmin;

/**
 * 测试数据Entity
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Table(name = "zt_goodsquan", alias = "a", columns = {
		@Column(name = "id", attrName = "id", label = "编号", isPK = true),
		@Column(name = "zt_goodsid", attrName = "ztGoodsid", label = "商品id"),
		@Column(name = "quanid", attrName = "ztQuan.id", label = "券id"),
		@Column(name = "status", attrName = "status", label = "状态"),
		@Column(name = "create_date", attrName = "createDate", label = "创建时间"), },
		
		joinTable = { 
			@JoinTable(type = Type.LEFT_JOIN, entity = ZtQuan.class, attrName = "ztQuan", alias = "q", on = "q.id = a.quanid", columns = {
			@Column(name = "type", label = "券的类型"),
			@Column(name = "price", label = "券的价值"),
			@Column(name = "edu", label = "券的价值"),
			@Column(name = "img", label = "券的图片"),
			@Column(name = "level_range", attrName = "levelRange", label = "发券人范围"),
			@Column(name = "usestatus", label = "券是否有效"),			
			@Column(name = "over_count",attrName="overCount", label = "剩余"),
			@Column(name = "to_time",attrName="toTime", label = "到期时间"),
			@Column(name = "name", label = "券名", attrName = "name", queryType = QueryType.LIKE), })
		},
		orderBy = "a.create_date DESC")
public class ZtGoodsquan extends DataEntity<ZtGoodsquan> {

	private static final long serialVersionUID = 1L;
	
	private String status;
	private String ztGoodsidTemp;
	
	private String ztGoodsid;

	private ZtQuan ztQuan;//券
	

	public String getZtGoodsidTemp() {
		return ztGoodsidTemp;
	}

	public void setZtGoodsidTemp(String ztGoodsidTemp) {
		this.ztGoodsidTemp = ztGoodsidTemp;
	}

	public ZtQuan getZtQuan() {
		return ztQuan;
	}

	public void setZtQuan(ZtQuan ztQuan) {
		this.ztQuan = ztQuan;
	}

	public String getZtGoodsid() {
		return ztGoodsid;
	}

	public void setZtGoodsid(String ztGoodsid) {
		this.ztGoodsid = ztGoodsid;
	}

	@JsonIgnore
	private Date createDate;
	@JsonIgnore
	private String updateBy;
	@JsonIgnore
	private String createBy;
	@JsonIgnore
	private Date updateDate;

	@JsonIgnore
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

}